import { setupRouter } from '@/router'
import { setupStore } from '@/store'
import { setupVab } from '@vab/setup'
import { createApp } from 'vue'
import { ElTable, ElTableColumn } from 'element-plus'
import App from './App.vue'

// 获取组件的props
const TableProps = ElTable.props
const TableColumnProps = ElTableColumn.props

// 修改默认props
// 全局el-table设置
TableProps.border = { type: Boolean, default: true } // 边框线
// 全局el-table-column设置
TableColumnProps.align = { type: String, default: 'center' } // 居中
TableColumnProps.showOverflowTooltip = { type: Boolean, default: true } // 文本溢出

const app = createApp(App)

/**
 * @description 生产环境启用组件初始化，编译，渲染和补丁性能跟踪。仅在开发模式和支持 Performance.mark API的浏览器中工作。
 */
if (process.env.NODE_ENV === 'development') app.config.performance = true
setupVab(app)
setupStore(app)
setupRouter(app)
  .isReady()
  .then(() => app.mount('#app'))
